<template>
    <div class="block" style="text-align: right">
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="page"
                :page-sizes="[20, 50, 100, 200]"
                :page-size="size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total">
        </el-pagination>
    </div>
</template>

<script>
    export default {
        name: 'tablePager',
        props:['loading','page','size','total'],
        data () {
            return {

            }
        },
        created() {

        },
        mounted() {

        },
        methods: {
            handleSizeChange(val) {
                //this.tableData.size=val;
                //this.loading=true;
                this.$emit('update:size',val);
                this.$emit('update:loading',true);
                this.$emit('loadData',true);
            },
            handleCurrentChange(val) {
                //this.tableData.page=val;
                console.log(val);
                this.$emit('update:page',val);
                this.$emit('update:loading',true);
                this.$emit('loadData',true);

            },
        }
    }
</script>

